import logging

import yagmail
import yaml


def setup_selector():
    logging.basicConfig(filename='kongfuzi.txt',level=logging.DEBUG,filemode='w+',format='%(levelname)s->%(asctime)s->%(message)s')
def send_mail(filename):
    ya=yagmail.SMTP(user='3974562803@qq.com',password='xxqhmxvushrqcbfh',host='smtp.qq.com')
    ya.send(to='maqiyun1234@qq.com',subject='今日测试主题',contents='今日孔夫子测试报告,请查收',attachments=filename)
def datayaml(filepath):
    with open(filepath,'r',encoding='utf-8')as f:
        return yaml.safe_load(f)